<HTML><HEAD><TITLE>trigger(+Trigger)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Advanced Control and Suspensions</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>trigger(+Trigger)</H1>
Wake the suspensions associated with the symbolic trigger Trigger
until there are no more left.


<DL>
<DT><EM>Trigger</EM></DT>
<DD>An atom.
</DD>
</DL>
<H2>Description</H2>
   Suspensions in ECLiPSe go through several stages: They are created,
   attached to variables or symbolic triggers, later scheduled for execution,
   and finally executed.

<P>
   The task of trigger/1 is to take suspensions from the global suspension
   list associated to the symbolic name Trigger and wake them.  The
   suspensions are inserted into a global priority list, according to
   their individual priority, and then executed. Trigger/1 includes a
   call to wake/0 and is actually defined as
   <PRE>
       trigger(Trigger) :-
	   schedule_suspensions(Trigger),
	   wake.
   </PRE>
<P>
   If no suspensions are associated to Trigger, trigger/1
   just succeeds and does nothing.

<P>

<H3>Fail Conditions</H3>
Fails if a woken goal fails
<H2>Examples</H2>
<PRE>
[eclipse 1]: suspend(writeln(world), 2, trigger(hello)), trigger(hello).
world
yes.




</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/compiler/demon-1.html">demon / 1</A>, <A HREF="../../kernel/suspensions/attach_suspensions-2.html">attach_suspensions / 2</A>, <A HREF="../../kernel/suspensions/make_suspension-3.html">make_suspension / 3</A>, <A HREF="../../kernel/suspensions/suspend-3.html">suspend / 3</A>
</BODY></HTML>
